package org.sakai.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.sakai.entity.AIConversationMessage;
import java.util.List;

@Mapper
public interface AIConversationMessageMapper {
    /**
     * 插入新消息
     */
    int insert(AIConversationMessage message);
    
    /**
     * 获取会话的所有消息
     */
    List<AIConversationMessage> getConversationMessages(@Param("conversationId") Long conversationId);
    
    /**
     * 获取会话的最近N条消息
     */
    List<AIConversationMessage> getRecentMessages(@Param("conversationId") Long conversationId, 
                                                @Param("limit") Integer limit);
} 